package com.zhouxiaoge.config;

import com.zhouxiaoge.config.entity.Config;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;


public class MyRowMapper implements RowMapper<Config> {

    @Override
    public Config mapRow(ResultSet rs, int rowNum) throws SQLException {
        String id = rs.getString("id");
        String key1 = rs.getString("key1");
        String value1 = rs.getString("value1");
        String application = rs.getString("application");
        String profile = rs.getString("profile");
        String label = rs.getString("label");

        Config config = new Config();
        config.setId(id);
        config.setKey1(key1);
        config.setValue1(value1);
        config.setApplication(application);
        config.setProfile(profile);
        config.setLabel(label);
        return config;
    }
}
